<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex align-stretch benben-position-layout flex recommendCommodityList_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex align-center justify-between flex-sub recommendCommodityList_fd0_0'>
          <view class='flex align-center' @tap="handleJumpDiy" data-type="back" data-url="1">
            <text class='fu-iconfont2  recommendCommodityList_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex align-center flex-sub recommendCommodityList_fd0_0_c1'>
            <text class='fu-iconfont2  recommendCommodityList_fd0_0_c1_c0'>&#xe738;</text>
            <benben-input class='flex-sub recommendCommodityList_fd0_0_c1_c1' type="text" :placeholder="`请输入商品名称`"
              confirm-type="done" :maxlength="-1" placeholder-style="color:rgba(191, 191, 191, 1);font-size:28rpx"
              @confirm="searchFunc()" v-model="keyword" />
            <image class='recommendCommodityList_fd0_0_c1_c2' mode="aspectFit" :src='STATIC_URL+"105.png"'
              @tap.stop="clearSearchFunc()"></image>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction align-stretch benben-flex-layout">
        <view class='flex flex-direction flex-wrap align-stretch recommendCommodityList_fd1_0'
          v-for="(item,index) in dataList" v-if="leixing==1" :key="index" @tap.stop="handleJumpDiy"
          data-type="navigateTo" :data-url="`/pages/grzx/fabuxiangqing/fabuxiangqing?id=${item.aid}`">
          <view class='flex flex-wrap align-center justify-between flex-sub'>
            <view class='flex flex-wrap align-center recommendCommodityList_fd1_0_c0_c0'>
              <view class='flex flex-wrap align-center recommendCommodityList_fd1_0_c0_c0_c0'>
                <image class='recommendCommodityList_fd1_0_c0_c0_c0_c0' mode="aspectFill" :src='item.avatar'>
                </image>
                <image class='recommendCommodityList_fd1_0_c0_c0_c0_c1' v-if="item.is_top==1" mode="aspectFill"
                  :src='STATIC_URL+"157.png"'>
                </image>
              </view>
              <text>{{item.user_nickname}}</text>
            </view>
            <view class='flex flex-wrap align-center'>
              <image class='recommendCommodityList_fd1_0_c0_c1_c0' mode="aspectFit" :src='STATIC_URL+"150.png"'></image>
              <text class='recommendCommodityList_fd1_0_c0_c1_c1'>{{item.views}}</text>
            </view>
          </view>
          <view class='flex flex-wrap align-center recommendCommodityList_fd1_0_c1'>
            <text class='recommendCommodityList_fd1_0_c1_c0'
              v-for="(itemA,indexA) in item.postcate_name">{{itemA}}</text>
          </view>
          <text class='recommendCommodityList_fd1_0_c2' v-if="item.gerenjianjie">{{item.gerenjianjie}}</text>
          <text class='recommendCommodityList_fd1_0_c3'>期望工作地：{{item.workplace_name}}</text>
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction align-stretch benben-flex-layout">
        <view class='flex flex-direction flex-wrap align-stretch flex-sub recommendCommodityList_fd2_0'
          @tap.stop="handleJumpDiy" data-type="navigateTo"
          :data-url="`/pages/grzx/fabuxiangqing/fabuxiangqing?id=${item.aid}`" v-for="(item,index) in dataList"
          v-if="leixing==0" :key="index">
          <view class='flex flex-direction flex-wrap align-stretch recommendCommodityList_fd2_0_c0'>
            <view class='flex flex-wrap align-center justify-between flex-sub'>
              <text class='recommendCommodityList_fd2_0_c0_c0_c0'>{{item.zhiweimingcheng}}</text>
              <view class='flex flex-wrap align-center'>
                <image class='recommendCommodityList_fd2_0_c0_c0_c1_c0' mode="aspectFit" :src='STATIC_URL+"150.png"'>
                </image>
                <text class='recommendCommodityList_fd2_0_c0_c0_c1_c1'>{{item.views}}</text>
              </view>
            </view>
            <view class='flex flex-wrap align-center recommendCommodityList_fd2_0_c0_c1'>
              <view class='flex flex-wrap align-center recommendCommodityList_fd2_0_c0_c1_c0'>
                <text>{{item.work_nature_name}}</text>
              </view>
              <view class='flex flex-wrap align-center recommendCommodityList_fd2_0_c0_c1_c1'
                v-for="(itemA,indexA) in item.postcate_name">
                <text>{{itemA}}</text>
              </view>
              <!--   <view class='flex flex-wrap align-center recommendCommodityList_fd2_0_c0_c1_c1'>
                <text>建筑相关</text>
              </view> -->
            </view>
            <text class='recommendCommodityList_fd2_0_c0_c2'>工作地点：{{item.workplace_name}}</text>
            <view class='flex flex-wrap align-center justify-between recommendCommodityList_fd2_0_c0_c3'>
              <view class='flex flex-wrap align-center recommendCommodityList_fd2_0_c0_c3_c0'>
                <image class='recommendCommodityList_fd2_0_c0_c3_c0_c0' mode="aspectFill" :src='item.avatar'>
                </image>
                <text>{{item.user_nickname}}</text>
              </view>
              <text class='recommendCommodityList_fd2_0_c0_c0_c1_c1'>{{item.gongsimingcheng}}</text>
            </view>
          </view>
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
        :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>

    </view>

  </view>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  import {
    validate
  } from '@/common/utils/validate.js'

  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        "allType": [{
          "name": "全部",
          "value": "0",
          "image": ""
        }, {
          "name": "最新",
          "value": "1",
          "image": ""
        }, {
          "name": "最热",
          "value": "2",
          "image": ""
        }],
        "all_id": "0",
        "allshow": false,
        "all_name": "全部",
        "screenType": [{
          "name": "推荐",
          "value": "1",
          "image": ""
        }, {
          "name": "视频",
          "value": "2",
          "image": ""
        }, {
          "name": "图文",
          "value": "3",
          "image": ""
        }],
        "screen_id": "1",
        "screenshow": false,
        "show_id": "1",
        "dataList": [],
        "userList": [],
        "is_recommend": "",
        "grass_type": "",
        "keyword": "",
        "cid": "",
        leixing: ''
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      let {
        keyword,
        cid,
        leixing
      } = options
      if (keyword !== undefined) this.keyword = keyword
      if (cid !== undefined) this.cid = cid
      if (leixing !== undefined) this.leixing = leixing
      this.getPostlistFunc()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      //获取帖子列表
      getPostlistFunc() {
        this.minixPagingListsApi = global.apiUrls.post65d4683f6c022;
        this.pageingListApiMethod = 'post';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {
          keywords: this.keyword,
          type: this.leixing //类型 0:雇员 1雇主
        }
        this.listData = [];
        this.dataList = this.listData;
        this.pagingListToggle();

      },
      //清除搜索框
      clearSearchFunc() {
        this.keyword = '';
        this.getPostlistFunc()
      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: #F8F8F8;
    background-size: 100% auto;
  }

  .recommendCommodityList_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .recommendCommodityList_fd0_0_c1_c2 {
    width: 20rpx;
    height: 20rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .recommendCommodityList_fd0_0_c1_c1 {
    font-size: 28rpx;
    font-weight: 400;
    color: var(--benbenFontColor0);
  }

  .recommendCommodityList_fd0_0_c1_c0 {
    font-size: 24rpx;
    color: rgba(153, 153, 153, 1);
    margin: 0rpx 14rpx 0rpx 0rpx;
  }

  .recommendCommodityList_fd0_0_c1 {
    background: #F9F9F9;
    height: 64rpx;
    border-radius: 34rpx 34rpx 34rpx 34rpx;
    padding: 0rpx 24rpx 0rpx 24rpx;
    margin: 0rpx 0rpx 0rpx 32rpx;
  }

  .recommendCommodityList_fd0_0_c0_c0 {
    font-size: 36rpx;
    font-weight: 500;
    color: #333;
  }

  .recommendCommodityList_fd0_0 {
    padding: 0rpx 24rpx 0rpx 24rpx;
    line-height: 88rpx;
  }

  .recommendCommodityList_fd1_0_c3 {
    margin: 24rpx 0rpx 0rpx 0rpx;
    color: rgba(119, 119, 119, 1);
  }

  .recommendCommodityList_fd1_0_c2 {
    background: #F9F9F9;
    border-radius: 4rpx;
    padding: 10rpx;
  }

  .recommendCommodityList_fd1_0_c1_c0 {
    background: #F9F9F9;
    border-radius: 4rpx;
    padding: 10rpx;
    margin: 0rpx 20rpx 0rpx 0rpx;
  }

  .recommendCommodityList_fd1_0_c1 {
    margin: 20rpx 0rpx 20rpx 0rpx;
  }

  .recommendCommodityList_fd1_0_c0_c1_c1 {
    margin: 0rpx 0rpx 0rpx 12rpx;
  }

  .recommendCommodityList_fd1_0_c0_c1_c0 {
    width: 32rpx;
    height: 32rpx;
  }

  .recommendCommodityList_fd1_0_c0_c0_c0_c1 {
    width: 85rpx;
    height: 72rpx;
    position: absolute;
    top: -20rpx;
    left: -20rpx;
  }

  .recommendCommodityList_fd1_0_c0_c0_c0_c0 {
    width: 120rpx;
    height: 120rpx;
    border-radius: 50%;
  }

  .recommendCommodityList_fd1_0_c0_c0_c0 {
    position: relative;
    margin: 0rpx 24rpx 0rpx 0rpx;
  }

  .recommendCommodityList_fd1_0_c0_c0 {
    color: #333;
    font-size: 32rpx;
  }

  .recommendCommodityList_fd1_0 {
    background: var(--benbenbgColor1);
    background-size: 100% auto;
    padding: 24rpx;
    margin: 10rpx 0rpx 0rpx 0rpx;
  }

  .recommendCommodityList_fd2_0_c0_c3_c0_c0 {
    width: 68rpx;
    height: 68rpx;
    margin: 0rpx 20rpx 0rpx 0rpx;
    border-radius: 50%;
  }

  .recommendCommodityList_fd2_0_c0_c3_c0 {
    color: var(--benbenFontColor1);
    font-size: 32rpx;
  }

  .recommendCommodityList_fd2_0_c0_c3 {
    margin: 30rpx 0rpx 10rpx 0rpx;
  }

  .recommendCommodityList_fd2_0_c0_c2 {
    border-bottom: 2px solid rgba(249, 249, 249, 1);
    color: rgba(102, 102, 102, 1);
    padding: 0rpx 0rpx 20rpx 0rpx;
  }

  .recommendCommodityList_fd2_0_c0_c1_c1 {
    background: rgba(249, 249, 249, 1);
    border-radius: 4rpx;
    height: 46rpx;
    line-height: 46rpx;
    padding: 0rpx 10rpx 0rpx 10rpx;
    color: var(--benbenFontColor1);
    margin: 0rpx 20rpx 0rpx 0rpx;
  }

  .recommendCommodityList_fd2_0_c0_c1_c0 {
    background: rgba(58, 167, 161, 0.6);
    border-radius: 4rpx;
    height: 46rpx;
    line-height: 46rpx;
    padding: 0rpx 10rpx 0rpx 10rpx;
    color: var(--benbenFontColor3);
    margin: 0rpx 20rpx 0rpx 0rpx;
  }

  .recommendCommodityList_fd2_0_c0_c1 {
    margin: 20rpx 0rpx 20rpx 0rpx;
  }

  .recommendCommodityList_fd2_0_c0_c0_c1_c1 {
    color: var(--benbenFontColor1);
  }

  .recommendCommodityList_fd2_0_c0_c0_c1_c0 {
    width: 32rpx;
    height: 32rpx;
    margin: 0rpx 24rpx 0rpx 0rpx;
  }

  .recommendCommodityList_fd2_0_c0_c0_c0 {
    font-size: 32rpx;
  }

  .recommendCommodityList_fd2_0_c0 {
    border-radius: 16rpx;
  }

  .recommendCommodityList_fd2_0 {
    background: var(--benbenbgColor1);
    padding: 24rpx;
    background-size: 100% auto;
    margin: 10rpx 0rpx 0rpx 0rpx;
  }
</style>
